package com.gome.ocean.service.gddl.impl;


import javax.annotation.Resource;

import org.apache.ibatis.session.RowBounds;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.github.pagehelper.Page;
import com.gome.ocean.dao.gddl.AppTableDAO;
import com.gome.ocean.dao.model.gddl.AppTableBO;
import com.gome.ocean.service.gddl.AppTableService;

@Service("appTableService")
@Transactional("transactionManager")
public class AppTableServiceImpl implements AppTableService {

    @Resource(name = "appTableDAO")
    private AppTableDAO appTableDAO;

    @Override
    public boolean insertAppTableBO(AppTableBO appTableBO) {
        return appTableDAO.insertAppTableBO(appTableBO) > 0;
    }

    @Override
    public boolean removeAppTableBOById(Long id) {
        return appTableDAO.removeAppTableBOById(id) > 0;
    }

    @Override
    public boolean updateAppTableBOById(AppTableBO appTableBO) {
        return appTableDAO.updateAppTableBOById(appTableBO) > 0;
    }

    @Override
    public AppTableBO findAppTableBOById(Long id) {
        return appTableDAO.findAppTableBOById(id);
    }

    @Override
    public AppTableBO findAppTableByLogicTableName(String logicName) {
        return appTableDAO.findAppTableByLogicTableName(logicName);
    }

    @Override
    public Page<AppTableBO> findAppTableByAppId(Long appId,Integer pageNum,Integer pageSize) {
        return (Page<AppTableBO>) appTableDAO.findAppTableByAppId(appId,new RowBounds(pageNum, pageSize));
    }
}
